import request from '@/utils/request'

export function login(data) {
  return request({
    data,
    url: '/user/signin',
    method: 'post'
  })
}

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}

export function updatePasswd(oldPass, newPass) {
  return request({
    data: { passwd: { oldPass, newPass }},
    url: '/user/passwd',
    method: 'put'
  })
}
